import request from '@/utils/request'

// 获取工单信息
export function workOrder(params) {
  return request({
    url: `/api/task-service/task/search`,
    method: 'get',
    params
  })
}
// 创建工单
export function setTypeList(data) {
  return request({
    url: '/api/task-service/task/create',
    method: 'POST',
    data
  })
}
// 获取工单详情
export function gettaskId(taskId) {
  return request({
    url: `/api/task-service/task/taskInfo/${taskId}`,
    method: 'get'

  })
}// 补货详情
export function ReplenishmentDetails(taskId) {
  return request({
    url: `/api/task-service/taskDetails/${taskId}`,
    method: 'get'
  })
}
// 获取补货预警值

export function earlyWarning() {
  return request({
    url: `/api/task-service/task/supplyAlertValue`,
    method: 'get'
  })
}

// 设置补货预警值

export function postearlyWarning(data) {
  return request({
    url: '/api/task-service/task/autoSupplyConfig',
    method: 'POST',
    data
  })
}

// 取消工单
export function cancelWorkOrder(data) {
  return request({
    url: `/api/task-service/task/cancel/${data.taskId}`,
    method: 'POST',
    data
  })
}

// 获取所有工单类型type

export function getTypeList() {
  return request({
    url: `/api/task-service/taskType/list`,
    method: 'GET'
  })
}

